<template>
  <div class="knowledge-graph-container">
    <div class="page-header">
      <h1 class="page-title">研究院知识图谱</h1>
      <p class="page-description">基于D3.js的交互式知识图谱可视化系统</p>
    </div>
    
    <div class="graph-container">
      <iframe 
        ref="graphIframe"
        src="/graph_visualization.html"
        class="graph-iframe"
        frameborder="0"
        @load="onIframeLoad"
      ></iframe>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'

// DOM引用
const graphIframe = ref(null)

// iframe加载完成处理
const onIframeLoad = () => {
  console.log('知识图谱iframe加载完成')
}

onMounted(() => {
  console.log('研究院知识图谱页面已挂载')
})
</script>

<style scoped>
.knowledge-graph-container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  text-align: center;
  margin-bottom: 20px;
}

.page-title {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.page-description {
  font-size: 16px;
  color: #666;
  margin: 0;
}

.graph-container {
  flex: 1;
  position: relative;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  min-height: 500px;
}

.graph-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .knowledge-graph-container {
    padding: 15px;
  }
  
  .page-title {
    font-size: 24px;
  }
}
</style>
